<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/image/favicon.ico">
    <title>大地时贷</title>
    <!-- Bootstrap core CSS -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/navbar.css" rel="stylesheet">
    <link href="/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <link href="/css/reg-detail.css" rel="stylesheet">
</head>
<body>
<div class="container" >
<nav class="navbar navbar-default navbar-fixed-top">
        <div class="navbar-header">

            <a class="navbar-brand" href="/index">
                <img src="/image/logo.png" height="30px" width="150px">
            </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li class="active">
                    <img src="/image/slogan.png" height="46px" width="155px">
                </li>
            </ul>
        </div>
</nav>
    <div class="row" >
        <div class="col-md-12" >
            <div class="form-title">
                <span class="title">完善一下信息</span>
            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left" >
               <label>年 龄：</label>
                <select id="age" class="selectpicker " title="请选择年龄段" >
                    <option value="16" checked>23周岁以下</option>
                    <option value="36">23-55周岁</option>
                    <option value="56">55周岁以上</option>
                </select>
            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <label>有过信用卡：</label>
                <div class="radio">
                    <label><input type="radio" NAME="isCreditCard" value="Y">是</label>
                    <label> <input type="radio" NAME="isCreditCard" VALUE="N" checked>否</label>
                </div>
            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <dl class="page-age">
                    <dt>所在城市：<br/><span>（工作城市或居住城市）</span></dt>
                    <dd>
                        <span class="right" >
                            <input id="address" style="color: #666;"  class="address_class" type="text" name="input_area"
                                   placeholder="填写中文/拼音">
                            <!-- 城市浮层 -->
                            <div id = "city_divId" class="city_div" >
                                    <ul  id="city_ul_id" class="city_ul_class">
                                    </ul>
                            </div>
                        </span>
                    </dd>
                </dl>
            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <dl>
                    <dt>在该城市已居住时间或工作时间：</dt>
                    <dd>
                        <input type="radio" name="liveTime" value="Y" checked><label>半年以上</label>
                        <input type="radio" name="liveTime" value="N"><label>半年以下</label>
                    </dd>
                </dl>
            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <dl>
                    <dt>在该城市有过房贷：</dt>
                    <dd>
                        <input type="radio" name="hasHouseLoan" value="Y" checked><label>是</label><input type="radio" name="hasHouseLoan" value="N"><label>否</label>
                    </dd>
                </dl>
            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <dl>
                    <dt>名下有私家车：</dt>
                    <dd>
                        <input type="radio" name="hasCar" value="Y" checked><label class="cs">是</label>
                        <input type="radio" name="hasCar" value="N"><label class="cf">否</label>
                    </dd>
                </dl>

            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <dl class="c">
                    <dt>目前还在还车贷：</dt>
                    <dd>
                        <input type="radio" name="payCarLoan" value="Y" checked><label>是</label>
                        <input type="radio" name="payCarLoan" value="N"><label>否</label>
                    </dd>
                </dl>

            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <dl class="page-age">
                    <dt>购买过寿险保单：<br/><span>（本人购买且仍在缴费中）</span></dt>
                    <dd>
                        <input type="radio" name="hasLifeInsurance" value="Y" checked><label class="bds">是</label>
                        <input type="radio" name="hasLifeInsurance" value="N"><label class="bdf">否</label>
                    </dd>
                </dl>

            </div>
        </div>
        <div class="col-md-3" >
            <div class="form-left">
                <dl class="page-age bd">
                    <dt>名下寿险年保费合计：<br/><span>（可多份叠加）</span></dt>
                    <dd>
                        <input type="radio" name="lifeInsuranceTotal" value="Y" checked><label>2400以上</label>
                        <input type="radio" name="lifeInsuranceTotal" value="N"><label>2400以下</label>
                    </dd>
                </dl>

            </div>
        </div>

    </div>
    <div class="form-btn ">
        <a href="javascript:void(0);" onclick="edit()" id="btnNext0">提交申请</a>
    </div>
</div><!-- /container -->

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>

<script src="/js/bootstrap.min.js"></script>
<script type="text/javascript">

    var userId=getQueryString("regdetail");

    function getQueryString(name) {
        //var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
       // var r = window.location.search.substr(1).match(reg);
        var q = window.location.pathname.substr(1).match(reg_rewrite);
        return q[2];
    }

    function edit(){
        $.ajax({
                type:'POST',
                url:'/json/edit',
                contentType: 'application/json;charset=utf-8',
                data: JSON.stringify(GetJsonData()),
                dataType:'json',
                success:function () {
                    window.location.href="/cont/common";
                },
                error:function () {
                    alert("++a++++c++");
                }
            }

        )

    }

    function GetJsonData() {
        var age = $.trim($("#age").val()); //年龄
        var isCreditCard= $.trim( $("input[name='isCreditCard']").val()); //有过信用卡
        var address= $.trim($("input[name='input_area']").val()); //手机号
        var liveTime= $.trim($("input[name='liveTime']").val()); //手机号
        var hasHouseLoan= $.trim($("input[name='hasHouseLoan']").val()); //手机号
        var hasCar= $.trim($("input[name='hasCar']").val()); //手机号
        var payCarLoan= $.trim($("input[name='payCarLoan']").val()); //手机号
        var hasLifeInsurance= $.trim($("input[name='hasLifeInsurance']").val()); //手机号
        var lifeInsuranceTotal= $.trim($("input[name='lifeInsuranceTotal']").val()); //手机号
        var json = {
            "id": userId,
            "age":age,
            "isCreditCard":isCreditCard,
            "address":address,
            "liveTime":liveTime,
            "hasHouseLoan":hasHouseLoan,
            "hasCar":hasCar,
            "payCarLoan":payCarLoan,
            "hasLifeInsurance":hasLifeInsurance,
            "lifeInsuranceTotal":lifeInsuranceTotal
        };

        return json;
    }

</script>
</body>
</html>